[staticanalysis]: Actually check errors on splice() of objects
authorColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 21:30:11 +0000 (17:30 -0400)
committerColin Walters <walters@verbum.org>
Sat, 21 Jun 2014 22:08:49 +0000 (18:08 -0400)
We were using unsigned size when we should have been using signed,
this means we basically weren't checking for errors on write...ouch.

Luckily if we e.g. hit ENOSPC during a pull, the checksums wouldn't
match and we'd return an error anyways.  However when writing an
object, we'd end up silently ignoring it =/

https://bugzilla.gnome.org/show_bug.cgi?id=732020

src/libostree/ostree-repo-commit.c

index 3ae8ae24877af39c71f1cc77c53e84f2a0fa3996..68cff05d4d730500338cbe84617693504683d70f 100644 (file)
@@ -365,7 +365,7 @@ write_object (OstreeRepo         *self,
   gboolean temp_file_is_regular;
   gboolean is_symlink = FALSE;
   char loose_objpath[_OSTREE_LOOSE_PATH_MAX];
-  gsize unpacked_size = 0;
+  gssize unpacked_size = 0;
   gboolean indexable = FALSE;
 
   g_return_val_if_fail (expected_checksum || out_csum, FALSE);